import java.util.Scanner;

public class test5 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请注册您的密码");
        int password = sc.nextInt();
         int count = 3;
         int a;
        System.out.println("请输入密码");
        while (sc.hasNextInt()) {
            a = sc.nextInt();
            if (a != password) {
                System.out.println("输入错误 请再次输入");
            }else{
                System.out.println("登陆成功");
                break;
            }
            count--;
            if(count == 0){
                System.out.println("退出程序");
                break;
            }
        }
    }
}
